/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package manager;

import java.util.HashMap;
import java.util.Map;
import model.Packet;
import model.Path;

/**
 *
 * @author wpc
 */
public class PathManager {

    private Map<Integer, Path> map;

    public PathManager() {
        map = new HashMap<Integer, Path>();
    }

    public void addPath(Path path){
        this.map.put(path.getId(), path);
    }

    public Path path(int key){
        return map.get(key);
    }

    public int queueId(Packet packet){
        Path path = map.get(packet.getPathId());
        return path.now(packet.getIndex());
    }

    public String getName(int key){
        return map.get(key).toString();
    }
}
